const { exec } = require("child_process");

// 远程仓库的URL
const remoteRepoUrl = "https://github.com/user/repo.git";
// 本地目录
const localDir = "/path/to/local/dir";

// 使用`git clone`命令克隆仓库
exec(`git clone ${remoteRepoUrl} ${localDir}`, (error, stdout, stderr) => {
  if (error) {
    console.error(`执行出错: ${error}`);
    return;
  }
  console.log(`stdout: ${stdout}`);
  console.error(`stderr: ${stderr}`);
});
